package com.wen.pojo;

import com.wen.utils.DateUtils;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * (Syslog)实体类
 *
 * @author makejava
 * @since 2021-02-21 16:48:12
 */


@Data
@AllArgsConstructor
@NoArgsConstructor
public class SysLog implements Serializable {
    private static final long serialVersionUID = 850045052256870434L;
    /**
     * 主键
     */

    private Integer id;

    /**
     * 访问时间
     */

    private Date visitTime;
    private String visitTimeStr;

    public String getVisitTimeStr() {
        if (visitTime != null) {
            return DateUtils.date2String(visitTime,"yyyy-MM-dd HH:mm");
        }
        return null;
    }

    /**
     * 操作者用户名
     */

    private String userName;

    /**
     * 访问ip
     */

    private String ip;

    /**
     * 访问资源url
     */

    private String url;

    /**
     * 访问时长
     */

    private Long executionTime;

    /**
     * 访问方法
     */

    private String method;


}